package com.ppc.dto;

import com.github.houbb.sensitive.word.bs.SensitiveWordBs;
import io.swagger.annotations.ApiModel;
import lombok.Data;

/**
 * 雇主修改订单
 *
 * @author LENOVO
 * @date 2023/12/20
 */
@Data
@ApiModel(description = "雇主修改订单")
public class EmployerTaskDTO {

  /**
   * 需求宽泛描述
   */
  private String requireBroadDesc;
  /**
   * 需求详细描述
   */
  private String requireDetailDesc;
  /**
   * 需求标题
   */
  private String requireTitle;
  /**
   * 订单id
   */
  private Long taskId;
  /**
   * 申诉原因
   */
  private String claimReason;

  /**
   * 敏感词
   */
  private String sensitiveWord;

  public boolean checkSensitive() {
    SensitiveWordBs sensitiveWordBs = SensitiveWordBs.newInstance();
    if (sensitiveWordBs.contains(requireBroadDesc)) {
      sensitiveWord=sensitiveWordBs.findFirst(requireBroadDesc);
      return true;
    } else if (sensitiveWordBs.contains(requireDetailDesc)) {
      sensitiveWord=sensitiveWordBs.findFirst(requireDetailDesc);
      return true;
    } else if (sensitiveWordBs.contains(requireTitle)) {
      sensitiveWord=sensitiveWordBs.findFirst(requireTitle);
      return true;
    } else {
      return false;
    }
  }

}
